﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.Depo.Aksesuar
{
    public partial class YeniTaranan : XForm
    {
        public YeniTaranan()
        {
            InitializeComponent();
        }

        private void YeniTaranan_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetAksYeniTaranan");
            gridView1.AddDetailGrid(gridView2, "Gun");
            
            gridView2.Columns["Tarih"].DisplayFormat.FormatString = "dd.MM.yyyy HH:mm";

            GridManager gm = GridManager.GetManager(gridView2);
            gm.GridMenu.AddMenu("Toplu Resim Göster", Buyut);

            gridView1.AddSummary("Adet");
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
            gridView1.MoveLast();
            //gridView1.MakeRowVisible(gridView1.FocusedRowHandle);

            gridView1.FocusedRowChanged += gridView1_FocusedRowChanged;
       }

        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            gridView2.BestFitColumns();
        }

        private void Buyut(object sender, EventArgs e)
        {
            string idxs = gridView2.GetSelectedValues("AksesuarId");
            using (Resimler rs = new Resimler(idxs))
                rs.ShowDialog();
        }
    }
}
